class Dog{
  name: string;
  age: number;
  //构造函数
  constructor(name: string, age: number) {
    console.log('构造函数执行了',this)
    this.name= name
    this.age= age
  }

  bark() {
    console.log('wangwangwang')
  }
}
const dog = new Dog('xiaohei',4);
console.log('dog',dog)